package com.lanyou.esb.datadictionary;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

public enum FtpScheduleUnit {

	SUN("1", "周日"),MON("2", "周一"),TUE("3", "周二"),WED("4", "周三"),THU("5", "周四"),FRI("6", "周五"),SAT("7", "周六");
	
	public static final String TypeCode = "10008";
	
	public final String ValueCode;
	public final String ValueName;

	private FtpScheduleUnit(String code, String name) {
		this.ValueCode = code;
		this.ValueName = name;
	}
	
	public static FtpScheduleUnit get(String valueCode)
			throws NoSuchObjectException {
		if (StringUtils.isEmpty(valueCode)) {
			throw new NullPointerException();
		}
		for (FtpScheduleUnit type : FtpScheduleUnit.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
